Skip to content

test: simplify how the CLI is built for tests#232

Merged
angeloashmore merged 6 commits into
mainfrom
aa/concurrent-tests
Jul 22, 2026
Merged

test: simplify how the CLI is built for tests#232
angeloashmore merged 6 commits into
mainfrom
aa/concurrent-tests

Conversation

@angeloashmore

@angeloashmore angeloashmore commented Jul 22, 2026

Copy link
Copy Markdown
Member

Resolves:

Description

We now more efficiently build the CLI before running tests. cross-env and concurrently are replaced by a Vitest hook, where we call tsdown's build function instead.

We also remove a test-specific ternary from the code, ensuring we are testing the real public CLI.

Checklist

  • A comprehensive Linear ticket, providing sufficient context and details to facilitate the review of the PR, is linked to the PR.
  • If my changes require tests, I added them.
  • If my changes affect backward compatibility, it has been discussed.
  • If my changes require an update to the CONTRIBUTING.md guide, I updated it.

Preview

How to QA 1

Run node --run unit — the suite builds the CLI itself and all 288 tests pass in ~80s. For watch mode, run node --run unit:watch, edit a file in src/, and confirm the CLI rebuilds and tests rerun.

🤖 Generated with Claude Code


Note

Low Risk
Changes are limited to dev/test tooling and a documented env override for sync poll interval; no auth or production behavior changes beyond removing unused env flags.

Overview
Test runs now build the CLI inside Vitest instead of pre-building via unit scripts with cross-env and concurrently. Global setup calls tsdown with an unminified, unbundled test config, rebuilds on reruns (watch), and forceRerunTriggers watch src/** rather than dist/index.mjs. unit / unit:watch are plain vitest run / vitest watch; concurrently and cross-env are removed from devDependencies.

Production build config is simplified: tsdown always minifies and no longer injects MODE / DEV / TEST—only PROD remains. Matching fields are dropped from env parsing.

prismic sync polling no longer branches on a compile-time test flag. It uses optional PRISMIC_SYNC_POLL_MS (default 5000); E2E harness sets 500 for faster sync tests.

Reviewed by Cursor Bugbot for commit 6e308ec. Bugbot is set up for automated code reviews on this repo. Configure here.

Footnotes

  1. Please use these labels when submitting a review:
    ❓ #ask: Ask a question.
    💡 #idea: Suggest an idea.
    ⚠️ #issue: Strongly suggest a change.
    🎉 #nice: Share a compliment.

angeloashmore and others added 4 commits July 22, 2026 19:13
Tests now run against the regular development build. The test-only
poll-interval override moves from a build-time TEST define to a
PRISMIC_SYNC_POLL_MS environment variable, which removes the cross-env
and concurrently dependencies and the MODE=test build step.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Tests always run against a fresh build: global setup builds once on
startup and again before each watch-mode rerun, triggered by src changes
instead of dist writes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@angeloashmore angeloashmore changed the title refactor(test): drop test-mode builds test: simplify how the CLI is built for tests Jul 22, 2026
@angeloashmore
angeloashmore marked this pull request as ready for review July 22, 2026 20:13

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit aa27235. Configure here.

Comment thread tsdown.config.ts Outdated
angeloashmore and others added 2 commits July 22, 2026 20:24
…tions to the test setup

tsdown.config.ts now always emits a bundled, minified artifact, matching
what CI publishes. The unbundled, unminified build used by tests is set
directly in test/setup.global.ts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@angeloashmore
angeloashmore merged commit ab152d1 into main Jul 22, 2026
39 of 42 checks passed
@angeloashmore
angeloashmore deleted the aa/concurrent-tests branch July 22, 2026 22:44
angeloashmore added a commit that referenced this pull request Jul 22, 2026
Take main's test-build infra from #232 (CLI built in test global setup,
always-minified tsdown config) and keep the evals project config on top.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants